if [[ $1 =~ '--gpus' ]]
then
    GPUS=${1:7}
    if [[ $GPUS == '1' ]]
    then
        cd /tmp/aiarts_launcher/anomaly_detection
        python tools/train_apulis.py --auto-scale-lr --no-validate $@
    else
        cd /tmp/aiarts_launcher/anomaly_detection
        PORT=${PORT:-29501}
        python -m torch.distributed.launch --nproc_per_node=$GPUS --master_port=$PORT \
            tools/train_apulis.py --launcher pytorch --auto-scale-lr --no-validate $@
    fi
fi